{layout name="layout" /}

<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i>
    <a href="{:url('index/index')}"> 首页</a>
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);"
        title="刷新">
        <i class="Hui-iconfont">&#xe68f;</i>
    </a>
</nav>

<div class="Hui-article">
    <article class="cl pd-20">
        <p class="f-20 text-success">欢迎{$Think.session.username}</p>
        <p>登录次数：{$loginCounts} </p>
        <p>上次登录IP：{$Think.session.last_ip} 上次登录时间：{$Think.session.last_time|date="Y-m-d H:i:s"}</p>
        <table class="table table-border table-bordered table-bg" style="min-width:900px;max-width:90%;">
            <thead>
                <tr>
                    <th colspan="7" scope="col">信息统计</th>
                </tr>
                <tr class="text-c">
                    <th>统计</th>
                    <th>文档库</th>
                    <th>专题库</th>
                    <th>用户</th>
                    <th>管理员</th>
                </tr>
            </thead>
            <tbody>
                <tr class="text-c">
                    <td>总数</td>
                    <td>{php}//echo model('article_info')->count('id');{/php}</td>
                    <td>{$topics}</td>
                    <td>0</td>
                    <td>{$users}</td>
                </tr>
            </tbody>
        </table>
        <table class="table table-border table-bordered table-bg mt-20" style="min-width:460px;max-width:48%;float:left;">
            <thead>
                <tr>
                    <th colspan="2" scope="col">服务器信息</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>网站域名</td>
                    <td>{$Think.server.http_host}</td>
                </tr>
                <tr>
                    <td width="40%">服务器计算机名</td>
                    <td>
                        <span id="lbServerName">{$Think.server.server_name}</span>
                    </td>
                </tr>
                <tr>
                    <td>服务器IP地址</td>
                    <td>{$Think.server.server_addr}</td>
                </tr>
                <tr>
                    <td>服务器运行环境</td>
                    <td>{$Think.php_os}</td>
                </tr>
                <tr>
                    <td>WEB服务版本</td>
                    <td>{$Think.server.server_software}</td>
                </tr>
                <tr>
                    <td class="bodyTd1">网站已用空间大小</td>
                    <td class="bodyTd1">
                        <span id="Info6">
                            <img src="/static/admin/images/loading.gif" alt="正在载入" class="mid"> Loading...
                        </span>
                        <span class="ml-50 c-blue">
                            <a href="javascript:clearCache();">清除缓存</a>
                        </span>
                    </td>
                </tr>
                <tr>
                    <td>网站版权所属</td>
                    <td>
                        <span id="Info7" runat="server" enableviewstate="false"></span>
                        <span style="font-size:22px;">©</span> XXXX公司版权所有
                    </td>
                </tr>
                <tr>
                    <td class="bodyTd1">网站技术支持</td>
                    <td class="bodyTd1">
                        <a href="javascript:void(0)" target="_blank">丰盈环蚀技术部</a>
                    </td>
                </tr>
            </tbody>
            <thead>
                <tr>
                    <th colspan="2" scope="col">客户端信息</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>当前使用的操作系统</td>
                    <td>{php}echo os_info();{/php}</td>
                </tr>
                <tr>
                    <td>当前使用的浏览器</td>
                    <td>{php}echo browser_info();{/php}</td>
                </tr>
            </tbody>
        </table>
        <table class="table table-border table-bordered table-bg mt-20" style="min-width:360px;max-width:40%;float:left;margin-left:2%;">
            <thead>
                <tr>
                    <th colspan="4" scope="col">最近登陆记录</th>
                </tr>
                <tr>
                    <th class='text-c' width="10%">序号</th>
                    <th class='text-c' width="30%">登陆时间</th>
                    <th class='text-c' width="20%">登陆IP</th>
                </tr>
            </thead>
            <tbody>
                {foreach $dataLogin as $key=>$val}
                <tr>
                    <td class='text-c'>{$key + 1}</td>
                    <td>{$val.time|date="Y-m-d H:i:s"}</td>
                    <td>{$val.ip}</td>
                </tr>
                {/foreach}
            </tbody>
        </table>
    </article>
</div>

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
    $(document).ready(function () {
        usedSpace();
    })
    function usedSpace(params) {
        $.post('usedspace', function (data) {
            if (data.code == 1) {
                $("#Info6").html(data.size);
            }
        }, 'json');
    }
    function clearCache() {
        $.post('clearcache', function (data) {
            if (data.code == 1) {
                layer.msg('清除成功',{
                    icon: 1,
                    time: 1000
                });
                $("#Info6").html('<img src="/static/admin/images/loading.gif" alt="正在载入" class="mid"> Loading...');
                usedSpace();
            }
        }, 'json');
    }
</script>
<!--请在上方写此页面业务相关的脚本-->